﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.Xpo;
using Aij1.Model;
using DevExpress.Data.Filtering;

namespace Aij1.BLL
{
    public class CommentData
    {
        public static void Delete(Session session, string ids)
        {
            string sql = String.Format("DELETE FROM A_Comment WHERE Oid IN ({0})", ids);
            session.ExecuteNonQuery(sql);
        }

        public static IList<A_Comment> GetComments(A_Article A)
        {
            XPCollection<A_Comment> comments = new XPCollection<A_Comment>(A.Session, CriteriaOperator.Parse("ArticleId=?", A));
            return comments;
        }
    }
}
